﻿<UserControls:ScrumItemControlBase x:Class="ScrumTable.UI.View.WinTouch.UserControls.AttachmentControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.microsoft.com/surface/2008" xmlns:Converter="clr-namespace:ScrumTable.UI.View.Converter;assembly=ScrumTable.UI.View"
    xmlns:UserControls="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls" xmlns:PieChart="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls.PieChart" xmlns:Util1="clr-namespace:ScrumTable.UI.View.Util;assembly=ScrumTable.UI.View" xmlns:CustomControl="clr-namespace:ScrumTable.UI.View.CustomControl;assembly=ScrumTable.UI.View"     
    PreviewTouchDown="OnUserStoryPreviewTouchDown" PreviewMouseDown="OnUserStoryPreviewMouseDown" s:SurfaceDragDrop.Drop="OnAttachementDrop" s:SurfaceDragDrop.PreviewQueryTarget="OnUserStoryPreviewQueryTarget"  AllowDrop="True" >
    <UserControl.Resources>        
        <Converter:ConverterUserStoryEffect x:Key="ConverterUserStoryBackGround"/>        
    </UserControl.Resources>
    <Grid Effect="{Binding Path=Parent, Converter={StaticResource ConverterUserStoryBackGround}}">      
        
        
        <!-- IconAttachment Symbol left-->
        <Grid Panel.ZIndex="1" Width="25" Height="22" Margin="0,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
            <Canvas Background="{StaticResource IconAttachment}" ></Canvas>
        </Grid>

        <Grid Panel.ZIndex="1"  Margin="0,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left">
            <s:SurfaceButton MinWidth="38" MinHeight="38" Background="{StaticResource IconEdit}" Click="OnSurfaceButtonClick" x:Name="EditButton" />
        </Grid>


        <Border BorderBrush="#FF000000" Background="Gray" Name="BackgroundRoot"  BorderThickness="2,2,2,2" CornerRadius="2,2,2,2" Margin="12,7,7,7" VerticalAlignment="Stretch">
            <Grid x:Name="DropRoot">
                <Grid.RowDefinitions>
                    <RowDefinition />
                </Grid.RowDefinitions>
                <StackPanel Orientation="Vertical" Margin="12,0,0,0" >
                    <Label x:Name="NameLabel" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=FontSize}">
                        <TextBlock TextWrapping="WrapWithOverflow" Text="{Binding Path=Name}" TextAlignment="Left">
                        </TextBlock>
                    </Label>                 
                </StackPanel>                             
            </Grid>
        </Border>

     
    </Grid>
</UserControls:ScrumItemControlBase>
